package com.atguigu.k_finally;

public class Demo {
    public static void main(String[] args) {
        try{
            System.out.println("try开始");
            System.out.println(7 / 0);
            System.out.println("try结束");
            //return; -> 方法虽然结束但是finally会执行

        } catch (ArithmeticException e){
            System.out.println("catch开始");
            System.out.println("e.getMessage() = " + e.getMessage());
            System.out.println("e = " + e);//e.toString()
            e.printStackTrace();
            System.out.println("catch结束");

        } finally {
            System.out.println("一定会执行的代码 !!!!!!!");
        }

        System.out.println("main结束");
    }
}
